SEPARATOR
SEPARATOR = ','
Collected addresses database
$primary_key : string
$readonly : bool
$groups : bool
$undelete : bool
$list_page : int
$page_size : int
$group_id : null|string|int
$ready : bool
$coltypes : array
$date_cols : string[]
$export_groups : bool
$searchonly : bool
$sort_col : string
$sort_order : string
$vcard_map : string[]
$db : \rcube_db
Store database connection.
$error : ?array
set_search_set(mixed $filter) : void
Sets a search filter.
This affects the contact set considered when using the count() and list_records() operations to those contacts that match the filter conditions. If no search filter is set, all contacts in the addressbook are considered.
This filter mechanism is applied in addition to other filter mechanisms, see the description of the count() operation.
mixed | $filter | Search params to use in listing method, obtained by get_search_set() |
set_group(mixed $group_id) : mixed
Sets/clears the current group.
This affects the contact set considered when using the count(), list_records() and search() operations to those contacts that belong to the given group. If no current group is set, all contacts in the addressbook are considered.
This filter mechanism is applied in addition to other filter mechanisms, see the description of the count() operation.
mixed | $group_id |
list_records(array $cols = null, int $subset, bool $nocount = false) : array
List the current set of contact records
array | $cols | List of cols to show, Null means all |
int | $subset | Only return this number of records, use negative values for tail |
bool | $nocount | True to skip the count query (select only) |
Indexed list of contact records, each a hash array
search(mixed $fields, mixed $value, int $mode, bool $select = true, bool $nocount = false, array $required = []) : \rcube_result_set
Search contacts
mixed | $fields | The field name or array of field names to search in |
mixed | $value | Search value (or array of values when $fields is array) |
int | $mode | Search mode. Sum of rcube_addressbook::SEARCH_* |
bool | $select | True if results are requested, False if count only |
bool | $nocount | True to skip the count query (select only) |
array | $required | List of fields that cannot be empty |
Contact records and 'count' value
count() : \rcube_result_set
Count the number of contacts in the database matching the current filter criteria.
The current filter criteria are defined by the search filter (see search()/set_search_set()) and the currently active group (see set_group()), if applicable.
Result set with values for 'count' and 'first'
get_record_groups(mixed $id) : array
Get group assignments of a specific contact record
mixed | $id | Record identifier |
List of assigned groups indexed by a group ID. Every array element can be just a group name (string), or an array with 'ID' and 'name' elements.
validate(array $save_data, bool $autofix = false) : bool
Check the given data before saving.
If input not valid, the message to display can be fetched using get_error()
array | $save_data | Associative array with data to save |
bool | $autofix | Try to fix/complete record automatically |
True if input is valid, False if not.
rename_group(string $group_id, string $newname, string $newid) : string|false
Rename a specific contact group
string | $group_id | Group identifier |
string | $newname | New name to set for this group |
string | $newid | New group identifier (if changed, otherwise don't set) |
New name on success, false if no data was changed
get_col_values(string $col, array $data, bool $flat = false) : array
Utility function to return all values of a certain data column either as flat list or grouped by subtype
string | $col | Col name |
array | $data | Record data array as used for saving |
bool | $flat | True to return one array with all values, False for hash array with values grouped by type |
List of column values
compose_display_name(array $contact, bool $full_email = false) : string
Compose a valid display name from the given structured contact data
array | $contact | Hash array with contact data as key-value pairs |
bool | $full_email | Don't attempt to extract components from the email address |
Display name
compose_list_name(array $contact) : string
Compose the name to display in the contacts list for the given contact record.
This respects the settings parameter how to list contacts.
array | $contact | Hash array with contact data as key-value pairs |
List name
compose_search_name(array $contact, string $email = null, string $name = null, string $templ = null) : string
Build contact display name for autocomplete listing
array | $contact | Hash array with contact data as key-value pairs |
string | Optional email address |
|
string | $name | Optional name (self::compose_list_name() result) |
string | $templ | Optional template to use (defaults to the 'contact_search_name' config option) |
Display name
compare_search_value(string $colname, string|array $value, string $search, int $mode) : bool
Compare search value with contact data
string | $colname | Data name |
string|array | $value | Data value |
string | $search | Search value |
int | $mode | Search mode |
Comparison result